import axios from 'axios'

export default {
  getData({ commit, state },{url,mutation}) {
   axios.get(url).then(response => {
    console.log(response)
    commit(mutation, {response})
   }).catch(err => {
    console.log(err)
   })
  },

  changeScroll({commit}) {
    commit('CHANGE_SCROLL')
  },

  refreshData({state},url) {
    axios.get(url).then(response => {
      console.log(response)
      state.status = response.status
      setTimeout(() => {
        state.status = null;
      },10)
    }).catch(err => {
      console.log(err)
    })
  }
}

